package com.zhouzi.zhaoyang.http

import com.zhouzi.zhaoyang.bean.*
import retrofit2.Call
import retrofit2.http.*

/**
 * Created by ZhouZi on 2019/7/4.
 * time:16:57
 * ----------Dragon be here!----------/
 * 　　　┏┓　　 ┏┓
 * 　　┏┛┻━━━┛┻┓━━━
 * 　　┃　　　　　 ┃
 * 　　┃　　　━　  ┃
 * 　　┃　┳┛　┗┳
 * 　　┃　　　　　 ┃
 * 　　┃　　　┻　  ┃
 * 　　┃　　　　   ┃
 * 　　┗━┓　　　┏━┛Code is far away from bug with the animal protecting
 * 　　　　┃　　　┃    神兽保佑,代码无bug
 * 　　　　┃　　　┃
 * 　　　　┃　　　┗━━━┓
 * 　　　　┃　　　　　　┣┓
 * 　　　　┃　　　　　　　┏┛
 * 　　　　┗┓┓┏━┳┓┏┛━━━━━
 * 　　　　　┃┫┫　┃┫┫
 * 　　　　　┗┻┛　┗┻┛
 * ━━━━━━━━━━━神兽出没━━━━━━━━━━━━━━
 */
interface ApiFunction {

    @POST(HttpConfig.GET_AUTH_CODE)
    @FormUrlEncoded
    fun getAuthCode(@FieldMap map: MutableMap<String, String>): Call<BaseBean<AuthCodeBean>>

    @POST(HttpConfig.PAY_ORDER)
    @FormUrlEncoded
    fun payOrder(@FieldMap map: MutableMap<String, String>): Call<BaseBean<Any?>>

    @POST(HttpConfig.LOGIN)
    @FormUrlEncoded
    fun login(@FieldMap map: MutableMap<String, String>): Call<BaseBean<LoginBean>>

    @GET(HttpConfig.GET_ORDER_NO)
    fun getOrderNo(@Query("deviceNo") deviceNo: String): Call<BaseBean<String>>

//    @GET(HttpConfig.GET_ORDER)
//    fun getOrder(@Query("outTradeNo") outTradeNo: String): Call<BaseBean<GetOrderBean>>

    @GET(HttpConfig.LOGOUT)
    fun logout(): Call<BaseBean<Any>>

    @GET(HttpConfig.GET_ADVERT_LIST)
    fun getAdvertList(@Query("deviceNo") deviceNo: String): Call<BaseBean<AdvertBean>>


    @POST(HttpConfig.GET_MEMBER_PRICE)
    @FormUrlEncoded
    fun getMemberPrice(
        @Field("deviceNo") deviceNo: String,
        @Field("totalFee") totalFee: String,
        @Field("phone") phone: String
    ): Call<BaseBean<VipPriceBean>>


    @GET(HttpConfig.GET_ORDER)
    fun getOrder(@Query("outTradeNo") outTradeNo: String?): Call<BaseBean<OrderDetailBean>>


    @GET(HttpConfig.GET_APP_OR_CODE)
    fun getAppQrCode(@Query("deviceNo") deviceNo: String): Call<BaseBean<String>>


    @POST(HttpConfig.VERSION_UPDATE)
    fun newest(@Query("versionNo") versionNo: String): Call<BaseBean<VersionCodeBean>>


    @POST(HttpConfig.MEMBER_PAY)
    @FormUrlEncoded
    fun memberPay(
        @FieldMap map: MutableMap<String, String>
    ): Call<BaseBean<BalancePaymentBean>>


    @POST(HttpConfig.PAY_DEPOSITORDER)
    @FormUrlEncoded
    fun payDepositorder(
        @FieldMap map: MutableMap<String, String>
    ): Call<BaseBean<CashPledgeBean>>


    @POST(HttpConfig.RETURN_DEPOSIT)
    @FormUrlEncoded
    fun returnDeposit(
        @FieldMap map: MutableMap<String, String>
    ): Call<BaseBean<String>>

    @GET(HttpConfig.CREATE_SACN_ORDER)
    fun createScanOrder(
        @QueryMap map: MutableMap<String, Any?>
    ): Call<BaseBean<CreateQRBean>>

    @GET(HttpConfig.CLOSE_ACCOUNT)
    fun getCloseAccount(
        @Query("deviceNo") deviceNo: String
    ): Call<BaseBean<CloseAccountBean>>


    @GET(HttpConfig.GET_LAST_ORDER_PRINT)
    fun getLastOrderPrint(
        @Query("deviceNo") deviceNo: String
    ): Call<BaseBean<OrderDetailBean>>


    @POST(HttpConfig.UPDATE_PASSWORD)
    @FormUrlEncoded
    fun updatePassword(
        @FieldMap map: MutableMap<String, String>
    ): Call<BaseBean<Any?>>


    @GET(HttpConfig.REFUND)
    fun refund(
        @QueryMap map: MutableMap<String, String>
    ): Call<BaseBean<Any?>>

    @POST(HttpConfig.GET_ORDER_LIST + "/{pageNum}/{pageSize}")
    @FormUrlEncoded
    fun getOrderList(
        @Path("pageNum") pageNum: Int,
        @Path("pageSize") pageSize: Int,
        @FieldMap map: MutableMap<String, Any>
    ): Call<BaseBean<GetOrderListBean2>>

    @POST(HttpConfig.GET_CLOSE_ACCOUNT_PRINT)
    @FormUrlEncoded
    fun getCloseAccountPrint(
        @FieldMap map: MutableMap<String, Any>
    ): Call<BaseBean<GetCloseAccountPrint>>

    @POST(HttpConfig.GET_ORDER_LIST_PRINT)
    @FormUrlEncoded
    fun getOrderListPrint(
        @FieldMap map: MutableMap<String, String>
    ): Call<BaseBean<GetOrderListPrintBean>>

    @POST(HttpConfig.SELECT_CLOSE_ACCOUNT_LIST+ "/{pageNum}/{pageSize}")
    fun selectCloseAccountList(
        @Path("pageNum") pageNum: Int,
        @Path("pageSize") pageSize: Int,
        @Body map: MutableMap<String, String>
    ): Call<BaseBean<SelectCloseAccountListBean>>

}